<?php 
/*
 * This file receives remote posts from the SMTransmitter
 * @author Chris Hickey
 */
require_once("framework.php");

if($_POST){
    $vars = parse_ini_file(SM_CONFIG_FULL_PATH);
    $connector = new MySQLConnector($vars['db_host'], $vars['db_user'], $vars['db_pw'], $vars['db_name']);
    $receiver = new SMReceiverModel($_POST, $connector);
    $receiver->authenticateRequest();
    $receiver->sanitize();
    $receiver->storeMessages();
}else{
    print "listening...";
}
?>